package com.enqualcomm.kids.network.socket.response;


import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by yinzhiqun on 2015/10/14.
 *
 */
public class TerminallistResult extends BasicResult{

    public List<Terminal> result;

    public static class Terminal implements Parcelable {
        public int isowner;
        public Icon icon;

        public String terminalid;
        public String userterminalid;

        /**
         * 未读消息数量
         */
        public int msgCount;
        /**
         * 未读聊天消息数量
         */
        public int chatCount;

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(isowner);
            dest.writeString(terminalid);
            dest.writeString(userterminalid);
            dest.writeInt(msgCount);
            dest.writeInt(chatCount);
        }

        public static final Creator<Terminal> CREATOR = new Creator<Terminal>() {

            @Override
            public Terminal createFromParcel(Parcel source) {
                Terminal result = new Terminal();

                result.isowner = source.readInt();
                result.terminalid = source.readString();
                result.userterminalid = source.readString();
                result.msgCount = source.readInt();
                result.chatCount = source.readInt();
                return result;
            }

            @Override
            public Terminal[] newArray(int size) {
                return null;
            }
        };
    }

    public static class Icon{
        public int fencing;
        public int alarm;
        public int silence;
    }

}
